<h1>部门管理 - <span id="secondHeading">管理员工</span></h1>
<div id="searchBar"><%=form_tag :action=>'list_employee'%>
	<img src="/images/opened1.gif"><a href="/adminorg/list_employee">显示正常员工</a>
	<img src="/images/locked.gif"><a href="/adminorg/list_employee?state=0">显示已停用员工</a>
	<img src="/images/search.gif">部门<select name="department_id">
    	<option value='-1'>所有</option>
		<% @departments.each do |department| %>
		<option value='<%=department.id%>'><%=department.name%></option>
		<% end %></select>
		姓名<input type="text" name="employee_name" size="10" maxlength="20">&nbsp;<input type="submit" class="sub" value="查询"><%end_form_tag%>
</div>
<% if @flash[:notice] -%>
<div id="notice"><%= @flash[:notice] %></div>
<% end -%>
<TABLE border="0" id="LIST_TB">
	<TR id="LIST_TB_TITLE">
	    <td>编号</td>
	    <td>姓名</td>
	    <td>英文名</td>
	    <td>角色</td>
            <!--
	    <td>分机</td>
            -->
	    <td>电话</td>
	    <td>手机</td>
	    <td>小灵通</td>
	    <td>Email</td>
	    <td colspan="3">相关操作</td>
	  </TR>
  
	<%@employees.each do |employee|%>
	<%if @sel_roles==nil || @sel_roles.include?(employee.account.role_id)%>
	
  <TR id="LIST_TB_CONTENT1">
    <td><%=formatSaleNum(employee.account.id,4)%></td>
    <td><%=employee.name%></td>
    <td><%=employee.english_name%></td>
    <td><%=employee.account.role.name%></td>
    <!--
    <td><%=employee.ext%></td>
    -->
    <td><%=employee.phone%></td>
    <td><%=employee.mobile%></td>
    <td><%=employee.lingtong%></td>
    <td><%=employee.email%></td>
    <td><a href="/adminorg/show_employee/<%=employee.id%>"><img src="/images/user_info.gif" title="查看员工信息" /></a></td>
    <td><a href="/adminorg/edit_employee/<%=employee.id%>"><img src="/images/edit.gif" title="编辑员工信息" /></a></td>
    <td><%if !employee.account.login.eql? 'admin'%><a href="/adminorg/<%='start_employee' if employee.state==0%><%='stop_employee' if employee.state==1%>/<%=employee.id%>" onclick="return confirm('你确定<%='启用' if employee.state==0%><%='停用' if employee.state==1%>该用户吗?');"><img src="/images/<%='yes.gif' if employee.state==0%><%='stop.gif' if employee.state==1%>" title="<%='启用' if employee.state==0%><%='停用' if employee.state==1%>" /></a><%end%></td>
  </tr>
  <%end%>
	<%end%>
</table>
<table>
        <tr>
                <td>
                        <input type="button" value="打印当前页" class="sub" onclick="openPrintWindow('LIST_TB')"/>
                        <input type="button" value="导出当前数据" class="sub" onclick="CellAreaExcel('LIST_TB')"/>
                </td>
                <td>
                        <div class="pagination">
                        <ul>
                                <li class="btn">
                                <%if @employee_pages.current.previous%>
                                <%=link_to("<<上一页", { :page => @employee_pages.current.previous })%>
                                <%else%>
                                <span>&lt;&lt;上一页</span>
                                <%end%>
                                </li>
                                <li><%= pagination_links(@employee_pages) if @employee_pages%></li>
                                <li class="btn">
                                <%if @employee_pages.current.next%>
                                <%=link_to("下一页>>", { :page => @employee_pages.current.next })%>
                                <%else%>
                                <span>下一页&gt;&gt;</span>
                                <%end%>
                                </li>
                        </ul>
                        </div>
                </td>
        </tr>
</table>
